package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;

/**
 * {@link org.rambadger.command.command Command} class for creating new {@link org.rambadger.command.model.PlatformAggregate Platforms}.
 */
public class CreatePlatform {
    @TargetAggregateIdentifier
    private final String platformId;
    private final String platformName;
    private final String description;

    /**
     * Instantiates a new Create platform.
     *
     * @param platformId The identifier of the platform being created, identifier is used in URLs as well as database IDs.
     * @param platformName A longer name of the platform. Used as a display title.
     * @param description A longer description field
     */
    public CreatePlatform(String platformId, String platformName, String description) {
        this.platformId = platformId;
        this.platformName = platformName;
        this.description = description;
    }

    /**
     * Gets platform id.
     *
     * @return the platform id
     */
    @UrlIdentifier @NotNull
    public String getPlatformId() {
        return platformId;
    }

    /**
     * Gets platform name.
     *
     * @return the platform name
     */
    @NotBlank @Length(max = 64)
    public String getPlatformName() {
        return platformName;
    }

    /**
     * Gets description.
     *
     * @return the description
     */
    @NotNull @Length(max = 4096)
    public String getDescription() {
        return description;
    }
}
